<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>申请消息列表</title>

    <!-- Bootstrap -->
    <link href="<%=request.getContextPath() %>/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="<%=request.getContextPath() %>/resources/css/datepicker.css" rel="stylesheet">
    <link href="<%=request.getContextPath() %>/resources/layui/css/layui.css" rel="stylesheet">
    <link href="<%=request.getContextPath() %>/resources/css/applymsghandle.css" rel="stylesheet">
    <script src="<%=request.getContextPath() %>/resources/jquery/jquery-1.11.3.min.js"></script>
    <script src="<%=request.getContextPath() %>/resources/bootstrap/js/bootstrap.min.js"></script>
    <script src="<%=request.getContextPath() %>/resources/layer/layer.js"></script>	
    <script src="<%=request.getContextPath() %>/resources/layui/layui.js"></script>		
    <script src="<%=request.getContextPath() %>/resources/js/numberChina.js"></script>	
 	<script src="<%=request.getContextPath() %>/resources/js/date-time/bootstrap-datepicker.js"></script>
    <script  src="<%=request.getContextPath() %>/resources/js/applymsghandle.js"></script>
	<link href="<%=request.getContextPath() %>/resources/img/tea.png" rel="icon">
</head>
<body class="hold-transition skin-blue sidebar-mini" style="background-image: linear-gradient(to top, #fff,#30A12B); height: 850px;">
<input id="usersequence" type="text" value='<%=session.getAttribute("usersequence") %>' hidden>
	<jsp:include page="/WEB-INF/jsp/menu.jsp" />


		
	<div class="container col-sm-12">
	
	<div class="form row">
		
	
        	<c:choose>
			<c:when test="${not empty list }">
				<div class="form-group col-sm-12" id="queryallDiv">
					<div class="col-sm-12" align="center">
						<table class="table" style="width:1300px">
							<thead>
					            <tr>
					                <th>用户</th>
					                <th>昵称</th>
					                <th>性别</th>
					                <th>邮箱</th>
					                <th>手机号</th>
              					    <th>验证消息</th>
					                <th>消息时间</th>
					                <th>操作</th>
					            </tr>
					        </thead>
					        <tbody>
								<c:forEach items="${list }" var="lis" varStatus="vs">
									<tr>
										<td><img src="${lis.img }" style="width: 50px;height: 50px;left:0;top: 0;border-radius: 50%;"  onclick="find(${lis.sequence})"/></td>
										<td>${lis.nickname }</td>
										<td>${lis.sex }</td>
										<td>${lis.email }</td>
										<td>${lis.phonenumber }</td>
										<td>${lis.message }</td>
										<td>${lis.create_dt }</td>
										<td> 
											<c:choose>
											<c:when test="${lis.state==1}">
												<input type="button" class="btn btn-success" onclick="agreeOne(${lis.msgsequence},${lis.state})" value='同意'>
												<input type="button" class="btn btn-warning" onclick="disagreeOne(${lis.msgsequence},${lis.state})" value='拒绝'>
												<input type="button" class="btn btn-info" onclick="handleOne(${lis.msgsequence})" value='处理'>
											</c:when>
											<c:otherwise>
												<input type="button" class="btn btn-info" onclick="handleOne(${lis.msgsequence})" value='处理'>
											</c:otherwise>
											</c:choose>
											
										</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
				
				    <div align="center" id="pageDiv">
						<font size="2">共 ${page.totalPageCount} 页</font> <font size="2">第
							${page.pageNow} 页</font> <a href="/TeaCulture/applymsghandle?pageNow=1">首页</a>
						<c:choose>
							<c:when test="${page.pageNow - 1 > 0}">
								<a href="/TeaCulture/applymsghandle?pageNow=${page.pageNow - 1}">上一页</a>
							</c:when>
							<c:when test="${page.pageNow - 1 <= 0}">
								<a href="/TeaCulture/applymsghandle?pageNow=1">上一页</a>
							</c:when>
						</c:choose>
						<c:choose>
							<c:when test="${page.totalPageCount==0}">
								<a href="/TeaCulture/applymsghandle?pageNow=${page.pageNow}">下一页</a>
							</c:when>
							<c:when test="${page.pageNow + 1 < page.totalPageCount}">
								<a href="/TeaCulture/applymsghandle?pageNow=${page.pageNow + 1}">下一页</a>
							</c:when>
							<c:when test="${page.pageNow + 1 >= page.totalPageCount}">
								<a href="/TeaCulture/applymsghandle?pageNow=${page.totalPageCount}">下一页</a>
							</c:when>
						</c:choose>
						<c:choose>
							<c:when test="${page.totalPageCount==0}">
								<a href="/TeaCulture/applymsghandle?pageNow=${page.pageNow}">尾页</a>
							</c:when>
							<c:otherwise>
								<a href="/TeaCulture/applymsghandle?pageNow=${page.totalPageCount}">尾页</a>
							</c:otherwise>
						</c:choose>
					</div>
				</div>
			</c:when>
			</c:choose>
		</div>
	</div>
</div>

    
</body>
</html>
